# eric7.Preferences.ShortcutDialog

Module implementing a dialog for the configuration of a keyboard shortcut.

### Global Attributes

None

### Classes

ShortcutDialog | Class implementing a dialog for the configuration of a keyboard shortcut.

### Functions

None

## ShortcutDialog

Class implementing a dialog for the configuration of a keyboard shortcut.

### Signals

shortcutChanged(QKeySequence, QKeySequence, bool, string)
  emitted after the OK button was pressed

### Derived from

QDialog, Ui_ShortcutDialog

### Class Attributes

None

### Class Methods

None

### Methods

ShortcutDialog | Constructor
__clear | Private slot to handle the Clear button press.
__clearKeys | Private method to clear the list of recorded keys.
__setKeyEditText | Private method to set the text of a key edit.
__typeChanged | Private slot to handle the change of the shortcuts type.
eventFilter | Public method called to filter the event queue.
keyPressEvent | Protected method to handle a key press event.
on_buttonBox_accepted | Private slot to handle the OK button press.
setKeys | Public method to set the key to be configured.

### Static Methods

None

#### ShortcutDialog (Constructor)

ShortcutDialog(parent=None, name=None, modal=False)

Constructor

parent (QWidget)
  The parent widget of this dialog.
name (str)
  The name of this dialog.
modal (bool)
  Flag indicating a modal dialog.

#### ShortcutDialog.__clear

__clear()

Private slot to handle the Clear button press.

#### ShortcutDialog.__clearKeys

__clearKeys()

Private method to clear the list of recorded keys.

#### ShortcutDialog.__setKeyEditText

__setKeyEditText(txt)

Private method to set the text of a key edit.

txt (str)
  text to be set

#### ShortcutDialog.__typeChanged

__typeChanged()

Private slot to handle the change of the shortcuts type.

#### ShortcutDialog.eventFilter

eventFilter(_watched, event)

Public method called to filter the event queue.

_watched (QObject)
  reference to the QObject being watched (unused)
event (QEvent)
  the event that occurred

Return:
  always False

Return Type:
  bool

#### ShortcutDialog.keyPressEvent

keyPressEvent(evt)

Protected method to handle a key press event.

evt (QKeyEvent)
  the key event

#### ShortcutDialog.on_buttonBox_accepted

on_buttonBox_accepted()

Private slot to handle the OK button press.

#### ShortcutDialog.setKeys

setKeys(key, alternateKey, noCheck, objectType)

Public method to set the key to be configured.

key (QKeySequence)
  key sequence to be changed
alternateKey (QKeySequence)
  alternate key sequence to be changed
noCheck (bool)
  flag indicating that no uniqueness check should be performed
objectType (str)
  type of the object

Up